/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.upc.dew.cobranzas.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import pe.edu.upc.dew.cobranzas.service.CuotaServiceImpl;

/**
 *
 * @author Ivan
 */
public class CuotaController implements Controller {

    private CuotaServiceImpl cuotaService;

    public void setCuotaService(CuotaServiceImpl cuotaService) {
        this.cuotaService = cuotaService;
    }

    public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        int idContrato;
        idContrato = Integer.parseInt(req.getParameter("contratoSeleccionado"));
        req.setAttribute("cuotasContrato", cuotaService.Listado(idContrato));
        return new ModelAndView("cuotas");
    }
}
